@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Quicksand&display=swap');

@import "inc/values";
@import "inc/fonts";
@import "inc/animations";
@import "inc/utils";
@import "inc/mixins";

@import "components/window";
@import "components/support-window";
@import "components/ui-toggle";
@import "components/progress-bar";
@import "components/upgrade";
@import "components/mergepedia";
@import "components/energy-core";
@import "components/processor-core";
@import "components/molecule";

@ui-scale: 1;

:root{
    --ui-scale: 1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

#app {
    height: 100vh;
    user-select: none;
    -moz-user-select: none;
}

body, html, input, select, button{
    font-size: 14px;

    @media (orientation: landscape) and (max-width: 1280px){
        font-size: 10px;
    }

    @media (orientation: landscape) and (max-width: 800px){
        font-size: 8px;
    }

    @media (orientation: landscape) and (max-width: 400px){
        font-size: 6px;
    }
    
    font-kerning: none;
    font-variant-numeric: lining-nums tabular-nums;
}

body {
    background: linear-gradient(to bottom, @color-bg-top, @color-bg-bottom);
    font-family: @font-family;
    padding: 0;
    margin: 0;
    overflow: hidden;
    font-weight: 700;
}

body, button, div {
    color: @color-text;
}

header {
    background-image: linear-gradient(75deg, @color-ui, @color-ui-fade);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    height: 4em;

    // YAMG Logo
    & > img{
        display: inline-block;
        height: 3em;
        width: auto;
        margin-right: 4em;
    }

    // Discord Link
    a {
        display: flex;
        align-items: center;
        font-size: 2em;
        text-decoration: none;
        color: aliceblue;

        img{
            height: 1.5em;
            margin-right: 0.25em;
        }
    }
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 900;
    .create-text-outlined(@font-family-header);
}

h1{
    font-size: 200%;
}

h2{
    font-size: 190%;
}

h3{
    font-size: 180%;
}

h4{
    font-size: 170%;
}

h5{
    font-size: 160%;
}

h6{
    font-size: 150%;
}

button {
    .create-button(@color-button);

    transition: transform 0.2s, filter 0.15s, box-shadow 0.2s;
    transition-timing-function: cubic-bezier(0.14, 0.35, 0.22, 2.2);

    &.buy{
        font-size: 175%;
        font-weight: 900;
        border-radius: 1em;
        padding-left: 0.5em;
        padding-right: 0.5em;
        min-width: 10ch;
    }

    &.cant-afford, &.hard-reset{
        .create-button(rgb(255, 48, 48));
    }

    &.locked, &:disabled{
        filter: brightness(0.5);
    }

    &.tab {
        width: 3.5rem;
        height: 3.5rem;
        margin: 0.25em;
        border-radius: 0.3em;
        padding: 0.3em;

        img {
            width: 100%;
            height: 100%;
        }
    }
    
    &.toggle-tabs {
        font-size: 3vh;
        width: 5vmax;
    }

    &.positive{
        .create-button(lime);
    }

    &.negative{
        .create-button(red);
    }
}

textarea, input[type="text"], option{
    background-color: @color-bg-input;
    color: @color-text-input;
    border-color: black;

    &::placeholder{
        color: @color-text-input;
        filter: brightness(0.75);
    }
}

select{
    .create-select(@color-button);

    option{
        clip-path: none;
    }
}

canvas.merger{
    width: 6em;
    height: 6em;
}

.key{
    display: inline-block;
    background-image: url(../images/icons/key.svg);
    background-size: contain;
    background-repeat: no-repeat;
    width: 1.75em;
    height: 1.75em;
    font-size: 70%;
}

.resource-view{
    display: inline-flex;
    justify-content: center;
    flex-wrap: wrap;
    position: sticky;
    right: 0;
    top: 0;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 1;

    img{
        margin-right: 0.5rem;
    }

    .resource{
        .create-text-outlined(@font-family-header);
        font-size: 135%;
        margin: 0.25rem 1.5rem;
    }
}

.overlay{
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1000;

    &.black{
        background-color: black;
    }
}

.card{
    .create-card(@color-ui);
}

canvas#mergedisplay {
    width: auto;
    max-height: calc(100vh - 9em + 1px);
    max-width: 100vw;
    transition: 0.3s;
    transition-timing-function: ease-in-out;

    &.tabs-shown {
        max-height: calc(46vh - 4em + 1px);

        @media (orientation: portrait) {
            height: auto;
            max-width: 0;
        }
    }

    @media (orientation: portrait) {
        display: block;
        height: auto;
        max-width: 100vw;
    }
}

// bottom game container
div.game-container {
    position: fixed;
    bottom: calc(-54vh + 5em);
    left: 0;
    height: 54vh;
    width: 100%;
    overflow: hidden;
    background-color: @color-ui;
    transition: bottom 0.3s;
    transition-timing-function: ease-in-out;

    .tab-settings .footer{
        bottom: -10vh;
    }

    .game-container-header{
        position: sticky;
        top: 0;
        z-index: 5;

        @media (orientation: portrait) {
            align-items: flex-start;
        }
    }

    &.tabs-shown {
        bottom: 0;
        overflow-y: auto;
            
        .tab-settings .footer{
            bottom: 1em;
        }
    }
}

// side containers
div.game-container-side {
    position: fixed;
    top: 7vh;
    width: 20vw;
    height: 40vh;
    overflow: hidden;
    background-color: lighten(@color-ui, 5%);
    transition: left 0.3s, right 0.3s;
    transition-timing-function: ease-in-out;

    @media (orientation: portrait) {
        width: 45vw;
        overflow-y: scroll;
    }

    .wrapper {
        height: 100%;
        align-items: center;
        padding: 0.5rem;
    }

    &.left{
        left: -20vw;
        border-top-right-radius: 2em;
        border-bottom-right-radius: 2em;
        
        @media (orientation: portrait) {
            left: -45vw;
        }

        &.tabs-shown {
            left: 0;
        }
    }

    &.right{
        right: -20vw;
        border-top-left-radius: 2em;
        border-bottom-left-radius: 2em;
        overflow-y: auto;

        // Utility buttons
        button{
            font-size: 130%;
            padding: 0;
            margin: 0.25rem;
        }

        @media (orientation: portrait) {
            right: -45vw;
        }

        &.tabs-shown {
            right: 0;
        }
    }
}

.game-container-side .selected-tab {
    text-align: center;
    font-size: 160%;
    height: 3.3rem;
    padding-top: 1rem;
}

table.upgrades {
    width: 95%;
    background-color: @color-table;
    border: 2px solid black;
    border-radius: 0.75em;
    padding: 0.5em;
    margin: 1em auto auto;

    .title{
        font-size: 120%;
        text-align: left;
    }
}

.molecule-selection{
    min-width: 250px;
    margin-top: -4em;

    & > div.selection{
        width: 100%;
    }
}

.tab-settings{
    padding-bottom: 7em;

    textarea{
        max-width: 90%;
    }

    .footer{
        position: fixed;
        left: 0;
        width: 100%;

        transition: bottom 500ms;

        button{
            font-size: 150%;
        }

        .support{
            font-size: 200%;
            .create-button(rgb(255, 0, 183));
            animation: glow 5s infinite linear;
        }
    }
}

.tab-settings textarea{
    max-width: 90%;
}